package com.example.demo.pojo.vo;

import com.example.demo.pojo.entity.QuestionLabel;
import com.example.demo.pojo.entity.SubjectFile;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageBankShowVO {
    private Integer id;
    private String fileName;
    private String labelName;
    private Integer realNumber;
    private Integer imageNumber;
    private List<PageBankShowVO>childrenLabelList=new ArrayList<>();
    private Integer showCategory;

    //第三种情况--出现题目和题型并存的情况

    public void initSubjectFile(SubjectFile nodeSubjectFile) {
        this.fileName=nodeSubjectFile.getFileName();
        if(this.id==null){
            this.id=nodeSubjectFile.getId();
        }
    }

    public void initQuestionLabel(QuestionLabel questionLabel) {
//        System.out.println(questionLabel);
//        System.out.println(this.id);
        if(this.id==null){
            this.id=questionLabel.getId();
        }
        this.labelName=questionLabel.getName();
    }
}
/*
* 用于当同时出现题型以及文件时，文件包含着题型。同时展示每种题型的数目
* */
class questionLabelWithFile{
    private Integer realNumberWith;
    private Integer imageNumberWith;
    private String labelName;
}
